<html>
<!--
    This work is licensed under Creative Commons GNU LGPL License.

    License: http://creativecommons.org/licenses/LGPL/2.1/
    Version: 0.5
    Author:  Michael Shook/2009
    Web:     http://del.icio.us/mshook
-->
<head>
<title>post2all.htm</title>
<style type="text/css">
body {
  font-family: sans-serif;
  font-size: 16px;
  margin: 50px;
}
</style>
<script>
P2A = {
    buildOnlyWireURL : function(form) {
        return "http://www.onlywire.com/api/add?url=" + P2A.encode(form.url.value)
            + "&title=" + P2A.encode(form.title.value)
            + "&comments=" + P2A.encode(form.text.value)
            + "&tags=" + P2A.encode(form.tags.value);
    },

    buildDeliciousURL : function(form) {
        return "https://api.del.icio.us/v1/posts/add?url=" + P2A.encode(form.url.value)
            + "&description=" + P2A.encode(form.title.value)
            + "&extended=" + P2A.encode(form.text.value)
            + "&tags=" + P2A.encode(form.tags.value);
    },

    buildTinyURL : function(form) {
        return "http://tinyurl.com/api-create.php?url=" + P2A.encode(form.url.value);
    },

    buildDelLinkbackURL : function(form) {
        return "http://del.icio.us/url?v=1&url="+P2A.encode(form.url.value);

    },

    encode : function(s) {
        return encodeURIComponent(s);
        return escape(s);
        return encodeURI(s);
        return s;
    }
}
</script>
</head>
<body>
<h1>post2all.htm</h1>
<a href="javascript:(function(){f='http://mshook.appspot.com/z/post2all.htm?url='+encodeURIComponent(window.location.href)+'&title='+encodeURIComponent(document.title)+'&v=5&';a=function(){if(!window.open(f+'noui=1&jump=doclose','deliciousuiv5','location=yes,links=no,scrollbars=yes,toolbar=no,width=800,height=550'))location.href=f+'jump=yes'};if(/Firefox/.test(navigator.userAgent)){setTimeout(a,0)}else{a()}})()">post2all bookmarklet</a> (drag to browser toolbar)
<br />
<form name="appform">
<br /> 
<label for="title">title/tweet: </label>
<br />
<textarea name="title" cols="80" rows="2" onchange="document.appform.titlelength.value=document.appform.title.value.length.toString();"></textarea>
<br />
<input type="button" onclick="document.appform.titlelength.value=document.appform.title.value.length.toString();" value="length:">
<label for="titlelength"></label> 
<input type="text" name="titlelength" size="10"> 
<br /> 
<label for="url">url: </label>
<br />
<textarea name="url" cols="80" rows="2"></textarea>
<br />
<a href="javascript:window.open(P2A.buildTinyURL(document.appform),'TinyURL','width=800,height=200');">tinyurl</a> <a href="javascript:window.open('http://bit.ly/','bit.ly','width=800,height=400');">bit.ly</a> <a href="javascript:window.open(P2A.buildDelLinkbackURL(document.appform), 'del.icio.us linkback','width=900,height=800,scrollbars=yes,toolbar=yes,menubar=yes,directories=yes');">del.icio.us linkback</a>
<br />
<label for="text">text or html: </label>
<br />
<textarea name="text" cols="80" rows="12" onchange="document.appform.textlength.value=document.appform.text.value.length.toString();"></textarea>
<br />
<input type="button" onclick="document.appform.textlength.value=document.appform.text.value.length.toString();" value="length:">
<label for="textlength"></label> 
<input type="text" name="textlength" size="10"> 
<br /> 
<label for="tags">tags: </label>
<br />
<textarea name="tags" cols="80" rows="2"></textarea>
<br />
<!--
<input type="button" onclick="window.location.href=P2A.buildOnlyWireURL(document.appform);" value="post">
-->
<input type="button" onclick="window.open(P2A.buildOnlyWireURL(document.appform),'Posting '+document.appform.title.value,'width=600,height=200');" value="post">
</form>
<script src="http://www.gmodules.com/ig/ifr?url=http://gingagadgets.com/lib2/gadget%3Fcaller%3Digoogletwitter_m_if&amp;up_title=Twitter&amp;up_gadget_height=400&amp;synd=open&amp;w=800&amp;h=300&amp;title=Twitter&amp;border=%23ffffff%7C3px%2C1px+solid+%23999999&amp;output=js"></script>
</body>
</html>

